$(document).ready(function(){
	haricount=getDays(tgl_mulai,tgl_berakhir);
	$('#jmlh').val(haricount);
	$.ajax({
		url: baseurl+"/index.php/tim/selBiaya",
		data: {
			id_provinsi:$('#Tim_id_provinsi').val(),
			id_kary:idkar,
		},
		dataType: "json",
		success: function(data) {
			if (data.res[0].code == 1) {
				// $("#hidtim").css("display","block");
				$('#harian').val(data.res[0].biaya_harian);
				$('#inap').val(data.res[0].biaya_penginapan);
				$('#tpd').val(data.res[0].nama_type_dinas);
				var trans = parseInt($('#Tim_biaya_trans').val());
				var airport = "";
				if($('#Tim_airportax').val() == ''){airport=0;}
				else {airport = parseInt($('#Tim_airportax').val());}
				var riil = parseInt($('#Tim_riil').val());
				hari = $('#jmlh').val();
				var total = (parseInt($('#harian').val())*parseInt(hari))+(parseInt($('#inap').val())*parseInt(hari));
				$('#total').val(total+trans+airport+riil);
				$('#totalAwal').val(total+trans+airport+riil);
			}
		}
	});
});